import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-01-15
 * Time: 9:24
 */
class Solution {
    public boolean containsDuplicate(int[] nums) {
        Map<Integer,Integer> hash = new HashMap<>();
        for(int i = 0 ; i < nums.length ; i++){
            int e = nums[i];
            hash.put(e,hash.getOrDefault(e,0)+1);
        }
        for(Map.Entry<Integer,Integer> hashMap : hash.entrySet()){
            if(hashMap.getValue() > 1){
                return true;
            }
        }
        return false;
    }
}
public class Test3 {
}
